<!-- create by 2021-3-2   -->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <title>购买页面</title>
    <link rel="stylesheet" href="./css/reset.css">
    <link rel="stylesheet" href="./css/buyCourse.css">
</head>

<body>
    <div id="addAdress">
        <div>
            <img src="./images/buy/adress.png">
            <span>添加地址</span>
        </div>
        <em></em>
    </div>
    <div id="courseInfo">
        <h4>科学体验课</h4>
        <p>赠送科学大礼包 专业社群老师辅导</p>
        <div id="dengji">
            <span>级别</span> 科学课
        </div>
        <div id="price">
            <i>￥</i>0
        </div>
        <div id="hasGift">
            <p>赠送礼盒信息</p>
            <span class="">无</span>
            <em class="dn"></em>
        </div>
    </div>
    <!-- 体验课是不会有优惠卷这栏 -->
    <div id="replaceMoney">
        <div class="le">
            <span>代金卷</span>
        </div>
        <div class="ri">
            <span>-￥<b>100</b></span>
            <em></em>
        </div>
    </div>
    <div id="payMethods">
        <ul>
            <li>
                <div>
                    <img src="./images/buy/wx.png" alt="">
                    <span>微信</span>
                </div>
                <img src="./images/buy/true.png" class="Checked" isChecked="1">
            </li>
            <li>
                <div>
                    <img src=" ./images/buy/zfb.png ">
                    <span>支付宝</span>
                </div>
                <img src="./images/buy/false.png " class="Checked" isChecked="0 ">
            </li>
        </ul>
    </div>
    <div id="buyBox">
        <div class="flexBox">
            <div>
                <span>应付金额:</span>
                <strong><i>￥</i>0</strong>
            </div>
            <button id="buy">立即购买</button>
        </div>
    </div>
    <div id="dislogBox">
        <div id="dialog">
            <p>已购买过该课程</p>
        </div>
    </div>

    <script src="./js/jq.min.js"></script>
    <script>
        // userAgentWx();   // 验证登录页面的是否处于微信浏览器，不属于则关闭
        // function userAgentWx() {
        //     var useragent = navigator.userAgent;
        //     if (useragent.match(/MicroMessenger/i) != 'MicroMessenger') {
        //         // 这里警告框会阻塞当前页面继续加载
        //         alert('请在微信客户端访问本页面');
        //         // 以下代码是用javascript强行关闭当前页面
        //         var opened = window.open('about:blank', '_self');
        //         opened.opener = null;
        //         opened.close();
        //     }
        // }
        $(".Checked").click(function (e) {
            e.preventDefault();
            let checked = $(this).attr("isChecked");
            $(".Checked").attr({
                "isChecked": "0",
                src: "./images/buy/false.png"
            })
            $(this).attr({
                "isChecked": "1",
                src: "./images/buy/true.png"
            });
        });
        /* 进入优惠卷页面
         *   
         */
        $("#replaceMoney").click(function (e) {
            e.preventDefault();
            location.href = "./replaceMoney.html";
        });
        /** 进入购物赠品信息列表页面
         *  
         */
        $("#hasGift").click(function (e) {
            e.preventDefault();
            let bool = $("#hasGift em").hasClass("dn");
            if (bool) {
                return false;
            }
            location.href = "./giftList.html";
        });
    </script>
</body>

</html>